{% extends "base.html" %}
{% block title %}添加书籍{% endblock %}
{% block content %}
<h2>添加书籍</h2>
<form method="POST" action="{{ url_for('book_manage.book_add') }}">
    {{ form.hidden_tag() }}
    <p>
        {{ form.name.label }}<br>
        {{ form.name(size=32) }}<br>
        {% for error in form.name.errors %}
            <span style="color: red;">[{{ error }}]</span>
        {% endfor %}
    </p>
    <p>
        {{ form.book_type_id.label }}<br>
        {{ form.book_type_id(size=32) }}<br>
        {% for error in form.book_type_id.errors %}
            <span style="color: red;">[{{ error }}]</span>
        {% endfor %}
    </p>
    <p>
        {{ form.author.label }}<br>
        {{ form.author(size=32) }}<br>
        {% for error in form.author.errors %}
            <span style="color: red;">[{{ error }}]</span>
        {% endfor %}
    </p>
    <p>
        {{ form.price.label }}<br>
        {{ form.price(size=32) }}<br>
        {% for error in form.price.errors %}
            <span style="color: red;">[{{ error }}]</span>
        {% endfor %}
    </p>
    <p>
        {{ form.available_count.label }}<br>
        {{ form.available_count(size=32) }}<br>
        {% for error in form.available_count.errors %}
            <span style="color: red;">[{{ error }}]</span>
        {% endfor %}
    </p>
    <p>
        {{ form.is_active.label }}<br>
        {{ form.is_active() }}<br>
        {% for error in form.is_active.errors %}
            <span style="color: red;">[{{ error }}]</span>
        {% endfor %}
    </p>
    <p>{{ form.submit() }}</p>
</form>
{% endblock %}